from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.chrome.service import Service

class BasePage():
    def __init__(self,driver):
        self.driver=driver

    def get_url(self,url):
        #打开url地址页面
        self.driver.get(url)

    def find_ele(self,loc):
        #元素定位
        ele=self.driver.find_element(*loc)
        return ele

    def input_ele(self,loc,value):
        #输入数据
        ele=self.find_ele(loc)
        ele.send_keys(value)

    def ele_click(self,loc):
        #点击按钮
        ele=self.find_ele(loc)
        ele.click()

    def ele_clear(self,loc):
        #输入框清空
        ele=self.find_ele(loc)
        ele.clear()
    def ele_html(self):
        ele=self.driver.switch_to.frame('e_iframe')
        return ele




